package heven.holt.library.http.cookie

import okhttp3.Cookie
import okhttp3.CookieJar
import okhttp3.HttpUrl

class CookieJarIml(
    private val cookieStore: CookieStore
) : CookieJar {
    override fun loadForRequest(url: HttpUrl): List<Cookie> {
        return cookieStore.get(url)
    }

    override fun saveFromResponse(url: HttpUrl, cookies: List<Cookie>) {
        cookieStore.add(url, cookies)
    }
}